package com.handinfo.engine.resource;

/**
 * @author Xia Mingwei
 * @version 1.0
 */
public abstract class ResourceSerialize
{
	public abstract boolean openSerialize(String name, boolean needCreate,
			boolean onlyOpenCatalog);

	public abstract boolean closeSerialize();

	public void setMaxCapacity(int maxCapacity)
	{
		m_maxCapacity = maxCapacity;
	}

	public void setMaxSingleCapacity(int maxCapacity)
	{
		m_maxSingleCapacity = maxCapacity;
	}

	abstract public byte[] readResource(ResHead head);

	abstract public void writeResource(ResHead head, byte[] data);

	abstract public void updateLastUsedFlag(ResHead head);

	abstract public boolean exist(ResHead head);
	
	abstract public void clear();

	protected int m_maxCapacity;
	protected int m_maxSingleCapacity;

}
